package Tracker.Data.DataBaseManagement;

import java.io.IOException;
import java.sql.SQLException;

import common.Content;
import common.User;



/**
 * classe para teste da classe DataManagement
 **/
public class DataManagementTestClass {

	/**
	 * @param args
	 * @throws SQLException 
	 * @throws ClassNotFoundException 
	 * @throws IOException 
	 */
	public static void main(String[] args) throws ClassNotFoundException, SQLException, IOException {
		
		
		DataManagement data = new DataManagement();
		
		//connection	
		data.ConnectToDataBase();
			
		//users		
		data.AddUser(new User("user1","user1",false));
				
		data.AddUser(new User("user2","user2",false));
		
		System.out.println(data.GetAllUsers());
		
		data.RemoveUser("user1");
		
		System.out.println(data.GetAllUsers());

		//contents		
		data.AddContent(new Content("content1","ip"));
				
		data.AddContent(new Content("content2","ip"));
		
		System.out.println(data.GetAllContents());

		data.RemoveContent("content1");
		
		System.out.println(data.GetAllContents());
		
		
	}

}
